3.1.100 \(\int \frac {(a+b \arctan (c x))^2}{x^2 (d+i c d x)} \, dx\) [100]

3.1.100.1 Optimal result
3.1.100.2 Mathematica [A] (verified)
3.1.100.3 Rubi [A] (verified)
3.1.100.4 Maple [C] (warning: unable to verify)
3.1.100.5 Fricas [F]
3.1.100.6 Sympy [F]
3.1.100.7 Maxima [F]
3.1.100.8 Giac [F]
3.1.100.9 Mupad [F(-1)]

3.1.100.1 Optimal result

Integrand size = 25, antiderivative size = 186 \[ \int \frac {(a+b \arctan (c x))^2}{x^2 (d+i c d x)} \, dx=-\frac {i c (a+b \arctan (c x))^2}{d}-\frac {(a+b \arctan (c x))^2}{d x}+\frac {2 b c (a+b \arctan (c x)) \log \left (2-\frac {2}{1-i c x}\right )}{d}-\frac {i c (a+b \arctan (c x))^2 \log \left (2-\frac {2}{1+i c x}\right )}{d}-\frac {i b^2 c \operatorname {PolyLog}\left (2,-1+\frac {2}{1-i c x}\right )}{d}+\frac {b c (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,-1+\frac {2}{1+i c x}\right )}{d}-\frac {i b^2 c \operatorname {PolyLog}\left (3,-1+\frac {2}{1+i c x}\right )}{2 d} \]

output
-I*c*(a+b*arctan(c*x))^2/d-(a+b*arctan(c*x))^2/d/x+2*b*c*(a+b*arctan(c*x)) 
*ln(2-2/(1-I*c*x))/d-I*c*(a+b*arctan(c*x))^2*ln(2-2/(1+I*c*x))/d-I*b^2*c*p 
olylog(2,-1+2/(1-I*c*x))/d+b*c*(a+b*arctan(c*x))*polylog(2,-1+2/(1+I*c*x)) 
/d-1/2*I*b^2*c*polylog(3,-1+2/(1+I*c*x))/d
 
3.1.100.2 Mathematica [A] (verified)

Time = 0.88 (sec) , antiderivative size = 268, normalized size of antiderivative = 1.44 \[ \int \frac {(a+b \arctan (c x))^2}{x^2 (d+i c d x)} \, dx=-\frac {\frac {2 a^2}{x}+2 a^2 c \arctan (c x)+2 i a^2 c \log (x)-i a^2 c \log \left (1+c^2 x^2\right )+\frac {2 a b \left (2 c x \arctan (c x)^2+\arctan (c x) \left (2+2 i c x \log \left (1-e^{2 i \arctan (c x)}\right )\right )+c x \left (-2 \log (c x)+\log \left (1+c^2 x^2\right )\right )+c x \operatorname {PolyLog}\left (2,e^{2 i \arctan (c x)}\right )\right )}{x}+2 i b^2 c \left (-\frac {i \pi ^3}{24}+\arctan (c x)^2-\frac {i \arctan (c x)^2}{c x}+\arctan (c x)^2 \log \left (1-e^{-2 i \arctan (c x)}\right )+2 i \arctan (c x) \log \left (1-e^{2 i \arctan (c x)}\right )+i \arctan (c x) \operatorname {PolyLog}\left (2,e^{-2 i \arctan (c x)}\right )+\operatorname {PolyLog}\left (2,e^{2 i \arctan (c x)}\right )+\frac {1}{2} \operatorname {PolyLog}\left (3,e^{-2 i \arctan (c x)}\right )\right )}{2 d} \]

input
Integrate[(a + b*ArcTan[c*x])^2/(x^2*(d + I*c*d*x)),x]
 
output
-1/2*((2*a^2)/x + 2*a^2*c*ArcTan[c*x] + (2*I)*a^2*c*Log[x] - I*a^2*c*Log[1 
 + c^2*x^2] + (2*a*b*(2*c*x*ArcTan[c*x]^2 + ArcTan[c*x]*(2 + (2*I)*c*x*Log 
[1 - E^((2*I)*ArcTan[c*x])]) + c*x*(-2*Log[c*x] + Log[1 + c^2*x^2]) + c*x* 
PolyLog[2, E^((2*I)*ArcTan[c*x])]))/x + (2*I)*b^2*c*((-1/24*I)*Pi^3 + ArcT 
an[c*x]^2 - (I*ArcTan[c*x]^2)/(c*x) + ArcTan[c*x]^2*Log[1 - E^((-2*I)*ArcT 
an[c*x])] + (2*I)*ArcTan[c*x]*Log[1 - E^((2*I)*ArcTan[c*x])] + I*ArcTan[c* 
x]*PolyLog[2, E^((-2*I)*ArcTan[c*x])] + PolyLog[2, E^((2*I)*ArcTan[c*x])] 
+ PolyLog[3, E^((-2*I)*ArcTan[c*x])]/2))/d
 
3.1.100.3 Rubi [A] (verified)

Time = 1.27 (sec) , antiderivative size = 195, normalized size of antiderivative = 1.05, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.360, Rules used = {5405, 27, 5361, 5403, 5459, 5403, 2897, 5529, 7164}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {(a+b \arctan (c x))^2}{x^2 (d+i c d x)} \, dx\)

\(\Big \downarrow \) 5405

\(\displaystyle \frac {\int \frac {(a+b \arctan (c x))^2}{x^2}dx}{d}-i c \int \frac {(a+b \arctan (c x))^2}{d x (i c x+1)}dx\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\int \frac {(a+b \arctan (c x))^2}{x^2}dx}{d}-\frac {i c \int \frac {(a+b \arctan (c x))^2}{x (i c x+1)}dx}{d}\)

\(\Big \downarrow \) 5361

\(\displaystyle \frac {2 b c \int \frac {a+b \arctan (c x)}{x \left (c^2 x^2+1\right )}dx-\frac {(a+b \arctan (c x))^2}{x}}{d}-\frac {i c \int \frac {(a+b \arctan (c x))^2}{x (i c x+1)}dx}{d}\)

\(\Big \downarrow \) 5403

\(\displaystyle \frac {2 b c \int \frac {a+b \arctan (c x)}{x \left (c^2 x^2+1\right )}dx-\frac {(a+b \arctan (c x))^2}{x}}{d}-\frac {i c \left (\log \left (2-\frac {2}{1+i c x}\right ) (a+b \arctan (c x))^2-2 b c \int \frac {(a+b \arctan (c x)) \log \left (2-\frac {2}{i c x+1}\right )}{c^2 x^2+1}dx\right )}{d}\)

\(\Big \downarrow \) 5459

\(\displaystyle \frac {-\frac {(a+b \arctan (c x))^2}{x}+2 b c \left (i \int \frac {a+b \arctan (c x)}{x (c x+i)}dx-\frac {i (a+b \arctan (c x))^2}{2 b}\right )}{d}-\frac {i c \left (\log \left (2-\frac {2}{1+i c x}\right ) (a+b \arctan (c x))^2-2 b c \int \frac {(a+b \arctan (c x)) \log \left (2-\frac {2}{i c x+1}\right )}{c^2 x^2+1}dx\right )}{d}\)

\(\Big \downarrow \) 5403

\(\displaystyle \frac {-\frac {(a+b \arctan (c x))^2}{x}+2 b c \left (i \left (i b c \int \frac {\log \left (2-\frac {2}{1-i c x}\right )}{c^2 x^2+1}dx-i \log \left (2-\frac {2}{1-i c x}\right ) (a+b \arctan (c x))\right )-\frac {i (a+b \arctan (c x))^2}{2 b}\right )}{d}-\frac {i c \left (\log \left (2-\frac {2}{1+i c x}\right ) (a+b \arctan (c x))^2-2 b c \int \frac {(a+b \arctan (c x)) \log \left (2-\frac {2}{i c x+1}\right )}{c^2 x^2+1}dx\right )}{d}\)

\(\Big \downarrow \) 2897

\(\displaystyle \frac {-\frac {(a+b \arctan (c x))^2}{x}+2 b c \left (i \left (-i \log \left (2-\frac {2}{1-i c x}\right ) (a+b \arctan (c x))-\frac {1}{2} b \operatorname {PolyLog}\left (2,\frac {2}{1-i c x}-1\right )\right )-\frac {i (a+b \arctan (c x))^2}{2 b}\right )}{d}-\frac {i c \left (\log \left (2-\frac {2}{1+i c x}\right ) (a+b \arctan (c x))^2-2 b c \int \frac {(a+b \arctan (c x)) \log \left (2-\frac {2}{i c x+1}\right )}{c^2 x^2+1}dx\right )}{d}\)

\(\Big \downarrow \) 5529

\(\displaystyle \frac {-\frac {(a+b \arctan (c x))^2}{x}+2 b c \left (i \left (-i \log \left (2-\frac {2}{1-i c x}\right ) (a+b \arctan (c x))-\frac {1}{2} b \operatorname {PolyLog}\left (2,\frac {2}{1-i c x}-1\right )\right )-\frac {i (a+b \arctan (c x))^2}{2 b}\right )}{d}-\frac {i c \left (\log \left (2-\frac {2}{1+i c x}\right ) (a+b \arctan (c x))^2-2 b c \left (\frac {1}{2} i b \int \frac {\operatorname {PolyLog}\left (2,\frac {2}{i c x+1}-1\right )}{c^2 x^2+1}dx-\frac {i \operatorname {PolyLog}\left (2,\frac {2}{i c x+1}-1\right ) (a+b \arctan (c x))}{2 c}\right )\right )}{d}\)

\(\Big \downarrow \) 7164

\(\displaystyle \frac {-\frac {(a+b \arctan (c x))^2}{x}+2 b c \left (i \left (-i \log \left (2-\frac {2}{1-i c x}\right ) (a+b \arctan (c x))-\frac {1}{2} b \operatorname {PolyLog}\left (2,\frac {2}{1-i c x}-1\right )\right )-\frac {i (a+b \arctan (c x))^2}{2 b}\right )}{d}-\frac {i c \left (\log \left (2-\frac {2}{1+i c x}\right ) (a+b \arctan (c x))^2-2 b c \left (-\frac {i \operatorname {PolyLog}\left (2,\frac {2}{i c x+1}-1\right ) (a+b \arctan (c x))}{2 c}-\frac {b \operatorname {PolyLog}\left (3,\frac {2}{i c x+1}-1\right )}{4 c}\right )\right )}{d}\)

input
Int[(a + b*ArcTan[c*x])^2/(x^2*(d + I*c*d*x)),x]
 
output
(-((a + b*ArcTan[c*x])^2/x) + 2*b*c*(((-1/2*I)*(a + b*ArcTan[c*x])^2)/b + 
I*((-I)*(a + b*ArcTan[c*x])*Log[2 - 2/(1 - I*c*x)] - (b*PolyLog[2, -1 + 2/ 
(1 - I*c*x)])/2)))/d - (I*c*((a + b*ArcTan[c*x])^2*Log[2 - 2/(1 + I*c*x)] 
- 2*b*c*(((-1/2*I)*(a + b*ArcTan[c*x])*PolyLog[2, -1 + 2/(1 + I*c*x)])/c - 
 (b*PolyLog[3, -1 + 2/(1 + I*c*x)])/(4*c))))/d
 

3.1.100.3.1 Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 2897
Int[Log[u_]*(Pq_)^(m_.), x_Symbol] :> With[{C = FullSimplify[Pq^m*((1 - u)/ 
D[u, x])]}, Simp[C*PolyLog[2, 1 - u], x] /; FreeQ[C, x]] /; IntegerQ[m] && 
PolyQ[Pq, x] && RationalFunctionQ[u, x] && LeQ[RationalFunctionExponents[u, 
 x][[2]], Expon[Pq, x]]
 

rule 5361
Int[((a_.) + ArcTan[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> 
 Simp[x^(m + 1)*((a + b*ArcTan[c*x^n])^p/(m + 1)), x] - Simp[b*c*n*(p/(m + 
1))   Int[x^(m + n)*((a + b*ArcTan[c*x^n])^(p - 1)/(1 + c^2*x^(2*n))), x], 
x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0] && (EqQ[p, 1] || (EqQ[n, 1] & 
& IntegerQ[m])) && NeQ[m, -1]
 

rule 5403
Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((x_)*((d_) + (e_.)*(x_))), x_ 
Symbol] :> Simp[(a + b*ArcTan[c*x])^p*(Log[2 - 2/(1 + e*(x/d))]/d), x] - Si 
mp[b*c*(p/d)   Int[(a + b*ArcTan[c*x])^(p - 1)*(Log[2 - 2/(1 + e*(x/d))]/(1 
 + c^2*x^2)), x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 0] && EqQ[c^2* 
d^2 + e^2, 0]
 

rule 5405
Int[(((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_))/((d_) + (e 
_.)*(x_)), x_Symbol] :> Simp[1/d   Int[(f*x)^m*(a + b*ArcTan[c*x])^p, x], x 
] - Simp[e/(d*f)   Int[(f*x)^(m + 1)*((a + b*ArcTan[c*x])^p/(d + e*x)), x], 
 x] /; FreeQ[{a, b, c, d, e, f}, x] && IGtQ[p, 0] && EqQ[c^2*d^2 + e^2, 0] 
&& LtQ[m, -1]
 

rule 5459
Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((x_)*((d_) + (e_.)*(x_)^2)), 
x_Symbol] :> Simp[(-I)*((a + b*ArcTan[c*x])^(p + 1)/(b*d*(p + 1))), x] + Si 
mp[I/d   Int[(a + b*ArcTan[c*x])^p/(x*(I + c*x)), x], x] /; FreeQ[{a, b, c, 
 d, e}, x] && EqQ[e, c^2*d] && GtQ[p, 0]
 

rule 5529
Int[(Log[u_]*((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.))/((d_) + (e_.)*(x_)^2 
), x_Symbol] :> Simp[(-I)*(a + b*ArcTan[c*x])^p*(PolyLog[2, 1 - u]/(2*c*d)) 
, x] + Simp[b*p*(I/2)   Int[(a + b*ArcTan[c*x])^(p - 1)*(PolyLog[2, 1 - u]/ 
(d + e*x^2)), x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 0] && EqQ[e, c 
^2*d] && EqQ[(1 - u)^2 - (1 - 2*(I/(I - c*x)))^2, 0]
 

rule 7164
Int[(u_)*PolyLog[n_, v_], x_Symbol] :> With[{w = DerivativeDivides[v, u*v, 
x]}, Simp[w*PolyLog[n + 1, v], x] /;  !FalseQ[w]] /; FreeQ[n, x]
 
3.1.100.4 Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 14.05 (sec) , antiderivative size = 8468, normalized size of antiderivative = 45.53

method result size
parts \(\text {Expression too large to display}\) \(8468\)
derivativedivides \(\text {Expression too large to display}\) \(8470\)
default \(\text {Expression too large to display}\) \(8470\)

input
int((a+b*arctan(c*x))^2/x^2/(d+I*c*d*x),x,method=_RETURNVERBOSE)
 
output
result too large to display
 
3.1.100.5 Fricas [F]

\[ \int \frac {(a+b \arctan (c x))^2}{x^2 (d+i c d x)} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2}}{{\left (i \, c d x + d\right )} x^{2}} \,d x } \]

input
integrate((a+b*arctan(c*x))^2/x^2/(d+I*c*d*x),x, algorithm="fricas")
 
output
1/4*(I*b^2*c*x*log(2*c*x/(c*x - I))*log(-(c*x + I)/(c*x - I))^2 + 2*I*b^2* 
c*x*dilog(-2*c*x/(c*x - I) + 1)*log(-(c*x + I)/(c*x - I)) - 2*I*b^2*c*x*po 
lylog(3, -(c*x + I)/(c*x - I)) + b^2*log(-(c*x + I)/(c*x - I))^2 + 4*d*x*i 
ntegral((-I*a^2*c*x + a^2 + ((a*b + I*b^2)*c*x + I*a*b)*log(-(c*x + I)/(c* 
x - I)))/(c^2*d*x^4 + d*x^2), x))/(d*x)
 
3.1.100.6 Sympy [F]

\[ \int \frac {(a+b \arctan (c x))^2}{x^2 (d+i c d x)} \, dx=- \frac {i \left (\int \frac {a^{2}}{c x^{3} - i x^{2}}\, dx + \int \frac {b^{2} \operatorname {atan}^{2}{\left (c x \right )}}{c x^{3} - i x^{2}}\, dx + \int \frac {2 a b \operatorname {atan}{\left (c x \right )}}{c x^{3} - i x^{2}}\, dx\right )}{d} \]

input
integrate((a+b*atan(c*x))**2/x**2/(d+I*c*d*x),x)
 
output
-I*(Integral(a**2/(c*x**3 - I*x**2), x) + Integral(b**2*atan(c*x)**2/(c*x* 
*3 - I*x**2), x) + Integral(2*a*b*atan(c*x)/(c*x**3 - I*x**2), x))/d
 
3.1.100.7 Maxima [F]

\[ \int \frac {(a+b \arctan (c x))^2}{x^2 (d+i c d x)} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2}}{{\left (i \, c d x + d\right )} x^{2}} \,d x } \]

input
integrate((a+b*arctan(c*x))^2/x^2/(d+I*c*d*x),x, algorithm="maxima")
 
output
a^2*(I*c*log(I*c*x + 1)/d - I*c*log(x)/d - 1/(d*x)) - 1/96*(24*b^2*c*x*arc 
tan(c*x)^3 + 3*I*b^2*c*x*log(c^2*x^2 + 1)^3 + 24*b^2*arctan(c*x)^2 - 2*I*( 
384*b^2*c^3*integrate(1/16*x^3*arctan(c*x)^2/(c^2*d*x^4 + d*x^2), x) + b^2 
*c*log(c^2*x^2 + 1)^3/d + 12*b^2*c*arctan(c*x)^2/d - 576*b^2*c*integrate(1 
/16*x*arctan(c*x)^2/(c^2*d*x^4 + d*x^2), x) - 48*b^2*c*integrate(1/16*x*lo 
g(c^2*x^2 + 1)^2/(c^2*d*x^4 + d*x^2), x) - 1536*a*b*c*integrate(1/16*x*arc 
tan(c*x)/(c^2*d*x^4 + d*x^2), x) + 192*b^2*c*integrate(1/16*x*log(c^2*x^2 
+ 1)/(c^2*d*x^4 + d*x^2), x) - 192*b^2*integrate(1/16*arctan(c*x)*log(c^2* 
x^2 + 1)/(c^2*d*x^4 + d*x^2), x))*d*x - 16*(b^2*c*arctan(c*x)^3/d + 12*b^2 
*c^2*integrate(1/16*x^2*log(c^2*x^2 + 1)^2/(c^2*d*x^4 + d*x^2), x) - 24*b^ 
2*c^2*integrate(1/16*x^2*log(c^2*x^2 + 1)/(c^2*d*x^4 + d*x^2), x) - 24*b^2 
*c*integrate(1/16*x*arctan(c*x)*log(c^2*x^2 + 1)/(c^2*d*x^4 + d*x^2), x) + 
 48*b^2*c*integrate(1/16*x*arctan(c*x)/(c^2*d*x^4 + d*x^2), x) + 72*b^2*in 
tegrate(1/16*arctan(c*x)^2/(c^2*d*x^4 + d*x^2), x) + 6*b^2*integrate(1/16* 
log(c^2*x^2 + 1)^2/(c^2*d*x^4 + d*x^2), x) + 192*a*b*integrate(1/16*arctan 
(c*x)/(c^2*d*x^4 + d*x^2), x))*d*x + 6*(b^2*c*x*arctan(c*x) - b^2)*log(c^2 
*x^2 + 1)^2 + 12*(I*b^2*c*x*arctan(c*x)^2 + 2*I*b^2*arctan(c*x))*log(c^2*x 
^2 + 1))/(d*x)
 
3.1.100.8 Giac [F]

\[ \int \frac {(a+b \arctan (c x))^2}{x^2 (d+i c d x)} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2}}{{\left (i \, c d x + d\right )} x^{2}} \,d x } \]

input
integrate((a+b*arctan(c*x))^2/x^2/(d+I*c*d*x),x, algorithm="giac")
 
output
sage0*x
 
3.1.100.9 Mupad [F(-1)]

Timed out. \[ \int \frac {(a+b \arctan (c x))^2}{x^2 (d+i c d x)} \, dx=\int \frac {{\left (a+b\,\mathrm {atan}\left (c\,x\right )\right )}^2}{x^2\,\left (d+c\,d\,x\,1{}\mathrm {i}\right )} \,d x \]

input
int((a + b*atan(c*x))^2/(x^2*(d + c*d*x*1i)),x)
 
output
int((a + b*atan(c*x))^2/(x^2*(d + c*d*x*1i)), x)